package com.example.demo.consumer;

import org.springframework.stereotype.Component;

import java.nio.charset.StandardCharsets;

@Component
public class MessageConsumer {

    public void receiveMessage(byte[] messageBody) {
        // 处理接收到的消息
        String message = new String(messageBody, StandardCharsets.UTF_8);
        System.out.println("接收到的消息: " + message);
    }
}   